<?php
class urlService extends Service{
    protected $module;
    protected $module_id=11;
    protected $data;
    public function __construct(){
        parent::__construct();
        $this->data=array();
        $this->module=load_module();
    }
    public function set_module_id($id){
        $this->module_id=$id;
    }
    //首页
    public function index(){
        return $this->module[$this->module_id]['static_rule_index'];
    }
    //列表页
    public function var_list_index(){
        $data=func_get_args();
        $this->data=array('{arccat_id}'=>$data[0]);
        return $this;
    }
    public function list_index($arr=array()){
        if(empty($arr)) $arr=$this->data;
        if(empty($arr)) return $this->module[$this->module_id]['static_rule_list_index'];
        list($http1,$file1)=$this->module[$this->module_id]['static_rule_list_index'];
        $search=array_keys($arr);
        $replace=array_values($arr);
        $http1=str_replace($search,$replace,$http1);
		$file1=str_replace($search,$replace,$file1);
        return array($http1,$file1);
    }
    public function var_list_i(){
        $data=func_get_args();
        $this->data=array('{arccat_id}'=>$data[0],'{i}'=>$data[1]);
        return $this;
    }
    public function list_i($arr=array()){
        if(empty($arr)) $arr=$this->data;
        if(empty($arr)) return $this->module[$this->module_id]['static_rule_list_i'];
        list($http1,$file1)=$this->module[$this->module_id]['static_rule_list_i'];
        $search=array_keys($arr);
        $replace=array_values($arr);
        $http1=str_replace($search,$replace,$http1);
		$file1=str_replace($search,$replace,$file1);
        return array($http1,$file1);
    }
    //内容页
    public function var_show(){
        $data=func_get_args();
        $this->data=array('{cat}'=>$data[0],'{id}'=>$data[1]);
        return $this;
    }
    public function show($arr=array()){
        if(empty($arr)) $arr=$this->data;
        if(empty($arr)) return $this->module[$this->module_id]['static_rule_show'];
        list($http1,$file1)=$this->module[$this->module_id]['static_rule_show'];
        $search=array_keys($arr);
        $replace=array_values($arr);
        $http1=str_replace($search,$replace,$http1);
		$file1=str_replace($search,$replace,$file1);
        return array($http1,$file1);
    }
    public function pagesize(){
        return $this->module[$this->module_id]['static_list_pagesize'];
    }
}